package com.meimeixia.pattern.prototype.test1;

import java.io.Serializable;

/**
 * 三好学生类
 */
public class Citation implements Cloneable, Serializable {

   /* private String name;

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }*/

    private Student stu;

    public Student getStu() {
        return stu;
    }

    public void setStu(Student stu) {
        this.stu = stu;
    }

    /**
     *
     * @return 因为克隆出来的肯定是三号学生类的对象，所以我们要将clone方法的返回值类型修改为Citation
     * @throws CloneNotSupportedException
     */

    @Override
    protected Citation clone() throws CloneNotSupportedException {
        return (Citation) super.clone();
    }

    public void show() {
//        System.out.println(name + "同学：在2021学年第一学期中表现优秀，被评为三好学生。特发此状！");
        System.out.println(stu.getName() + "同学：在2021学年第一学期中表现优秀，被评为三好学生。特发此状！");

    }
}
